document.querySelector(".account").onblur = checkUsername;
function checkUsername(){
    var account = document.querySelector(".account").value;
    if (account==""||account==null){
        document.querySelector(".account-msg").innerText="请输入账号";
        return false;
    }else{
        document.querySelector(".account-msg").innerText="";
        return true;
    }
}

document.querySelector(".password").onblur =checkPassword;
function checkPassword(){
    var password = document.querySelector(".password").value;
    if (password==""||password==null){
        document.querySelector(".password-msg").innerText="请输入密码";
        return false;
    }else{
        document.querySelector(".password-msg").innerText="";
        return true;
    }
}
//提交表单，验证
document.querySelector(".login-area").onsubmit= function(){
    return checkUsername() && checkPassword();//  return true / return false;
}

//点击按钮，触发的事件
document.querySelector(".denglu").onclick = function (){
    //账号
    var account = document.querySelector(".account").value;
    console.log("用户名："+account);
    var password = document.querySelector(".password").value;
    console.log("密码："+password);
}